// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * CatalogProductLink generated by hbm2java
 */
@Entity
@Table(name = "catalog_product_link", catalog = "magento", uniqueConstraints = @UniqueConstraint(columnNames = {
		"link_type_id", "product_id", "linked_product_id" }))
public class CatalogProductLink implements java.io.Serializable {
	private static final long serialVersionUID = 121323L;

	private Integer linkId;
	private CatalogProductEntity catalogProductEntityByLinkedProductId;
	private CatalogProductLinkType catalogProductLinkType;
	private CatalogProductEntity catalogProductEntityByProductId;
	private Set catalogProductLinkAttributeDecimals = new HashSet(0);
	private Set catalogProductLinkAttributeVarchars = new HashSet(0);
	private Set catalogProductLinkAttributeInts = new HashSet(0);

	public CatalogProductLink() {
	}

	public CatalogProductLink(
			CatalogProductEntity catalogProductEntityByLinkedProductId,
			CatalogProductLinkType catalogProductLinkType,
			CatalogProductEntity catalogProductEntityByProductId) {
		this.catalogProductEntityByLinkedProductId = catalogProductEntityByLinkedProductId;
		this.catalogProductLinkType = catalogProductLinkType;
		this.catalogProductEntityByProductId = catalogProductEntityByProductId;
	}

	public CatalogProductLink(
			CatalogProductEntity catalogProductEntityByLinkedProductId,
			CatalogProductLinkType catalogProductLinkType,
			CatalogProductEntity catalogProductEntityByProductId,
			Set catalogProductLinkAttributeDecimals,
			Set catalogProductLinkAttributeVarchars,
			Set catalogProductLinkAttributeInts) {
		this.catalogProductEntityByLinkedProductId = catalogProductEntityByLinkedProductId;
		this.catalogProductLinkType = catalogProductLinkType;
		this.catalogProductEntityByProductId = catalogProductEntityByProductId;
		this.catalogProductLinkAttributeDecimals = catalogProductLinkAttributeDecimals;
		this.catalogProductLinkAttributeVarchars = catalogProductLinkAttributeVarchars;
		this.catalogProductLinkAttributeInts = catalogProductLinkAttributeInts;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "link_id", unique = true, nullable = false)
	public Integer getLinkId() {
		return this.linkId;
	}

	public void setLinkId(Integer linkId) {
		this.linkId = linkId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "linked_product_id", nullable = false)
	public CatalogProductEntity getCatalogProductEntityByLinkedProductId() {
		return this.catalogProductEntityByLinkedProductId;
	}

	public void setCatalogProductEntityByLinkedProductId(
			CatalogProductEntity catalogProductEntityByLinkedProductId) {
		this.catalogProductEntityByLinkedProductId = catalogProductEntityByLinkedProductId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "link_type_id", nullable = false)
	public CatalogProductLinkType getCatalogProductLinkType() {
		return this.catalogProductLinkType;
	}

	public void setCatalogProductLinkType(
			CatalogProductLinkType catalogProductLinkType) {
		this.catalogProductLinkType = catalogProductLinkType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "product_id", nullable = false)
	public CatalogProductEntity getCatalogProductEntityByProductId() {
		return this.catalogProductEntityByProductId;
	}

	public void setCatalogProductEntityByProductId(
			CatalogProductEntity catalogProductEntityByProductId) {
		this.catalogProductEntityByProductId = catalogProductEntityByProductId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "catalogProductLink")
	public Set getCatalogProductLinkAttributeDecimals() {
		return this.catalogProductLinkAttributeDecimals;
	}

	public void setCatalogProductLinkAttributeDecimals(
			Set catalogProductLinkAttributeDecimals) {
		this.catalogProductLinkAttributeDecimals = catalogProductLinkAttributeDecimals;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "catalogProductLink")
	public Set getCatalogProductLinkAttributeVarchars() {
		return this.catalogProductLinkAttributeVarchars;
	}

	public void setCatalogProductLinkAttributeVarchars(
			Set catalogProductLinkAttributeVarchars) {
		this.catalogProductLinkAttributeVarchars = catalogProductLinkAttributeVarchars;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "catalogProductLink")
	public Set getCatalogProductLinkAttributeInts() {
		return this.catalogProductLinkAttributeInts;
	}

	public void setCatalogProductLinkAttributeInts(
			Set catalogProductLinkAttributeInts) {
		this.catalogProductLinkAttributeInts = catalogProductLinkAttributeInts;
	}

}
